package com.lzl.springboot.controller;

import com.lzl.springboot.model.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/reset")
public class RestConroller {

    @Autowired
    private Person person;
    @Value("${person.name}")
    private String personName;

    @RequestMapping("/hello/{id}")
    public String hello(@PathVariable String id) {
        return "hello"+id;
    }

    @RequestMapping("/getPersonInfo")
    public Person getPersonInfo() {
        return person;
    }

    @RequestMapping("/outParam")
    public String outParam() {
        return personName;
    }

}
